package com.winit.schedule.core.event;

/**
 * 事件调度接口，将事件分发至通过事件类型注册的事件处理器
 * 
 */
@SuppressWarnings("rawtypes")
public interface Dispatcher {

    // Configuration to make sure dispatcher crashes but doesn't do system-exit
    // in
    // case of errors. By default, it should be false, so that tests are not
    // affected. For all daemons it should be explicitly set to true so that
    // daemons can crash instead of hanging around.
    public static final String  DISPATCHER_EXIT_ON_ERROR_KEY     = "uschedule.dispatcher.exit-on-error";

    public static final boolean DEFAULT_DISPATCHER_EXIT_ON_ERROR = false;

    EventHandler getEventHandler();

    void register(Class<? extends Enum> eventType, EventHandler handler);

}
